package cn.pfz.domain;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.HashMap;

/**
 * @Author: 普发忠
 * @Date: 2021/10/09/15:49
 * 攻略主题
 */
@Data
@TableName("strategy_theme")
public class StrategyTheme extends BaseDomain {
    
    private String name;
    private Integer state=STATE_NORMAL; //默认正常
    private Integer seq;
    
    public String getStateDisplay(){
        return state==STATE_NORMAL ? "正常":"异常";
    }
    
    public String getJsonString(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",super.getId());
        map.put("name",this.getName());
        map.put("seq",this.getSeq());
        map.put("state",this.getState());
        return JSON.toJSONString(map);
    }
}
